package com.gelsanalyzer.ui.swing.command;

import java.awt.event.*;
import java.beans.*;

import javax.swing.*;

import org.apache.log4j.*;

import com.gelsanalyzer.mvc.controller.*;

public class ViewGoalReportCommand extends AbstractAction {
    private static final Logger log = Logger.getLogger(GetCoursesCommand.class);

    private IController controller;

    public ViewGoalReportCommand(String label, IController controller) {
        this(label, null, null, null, controller);
    }

    public ViewGoalReportCommand(String label,
                                 ImageIcon icon,
                                 String desc,
                                 Integer mnemonic,
                                 IController controller) {
        super(label, icon);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(MNEMONIC_KEY, mnemonic);
        this.controller = controller;
    }

    public void setController(IController controller) {
        this.controller = controller;
    }

    public void actionPerformed(ActionEvent e) {
        log.debug("Entered actionPerformed(ActionEvent) about to call "
                + "controller.propertyChange(PropertyChangeEvent");
        controller.propertyChange(new PropertyChangeEvent(this,
            IController.APP_VIEW_GOALS_REP, null, ViewGoalReportCommand.class
                .getResource("/data/goalReportData.xml")));
    }
}
